import 'uno.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { store } from './store'
import './styles/main.less'
import { setupErrorHandler } from './utils/errorHandler'
import { DiscreteApi } from './utils/naiveTools'

const app = createApp(App)

app.use(store)
app.use(router)

// 注册全局组件
import { setupGlobalComponents } from './components'
setupGlobalComponents(app)

app.mount('#app')

// 全局配置naive-ui的message等组件
const meta = document.createElement('meta')
meta.name = 'naive-ui-style'
document.head.appendChild(meta)

// 初始化 Naive UI 的离散 API
DiscreteApi.getInstance()

// 设置全局错误处理
setupErrorHandler()
